﻿using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Markup;

namespace XamlInspector.Presentation.Controls
{
    [ContentProperty(Name = "Items")]
    public sealed class TabControl : ListBox
    {
        public TabControl()
        {
            DefaultStyleKey = typeof(TabControl);
        }

        protected override void OnItemsChanged(object e)
        {
            base.OnItemsChanged(e);
            if (Items != null && Items.Count > 0)
            {
                SelectedIndex = 0;
            }
        }
    }
}
